package cn.ssm_05.factory;

import cn.ssm_05.dao.UserDaoImpl;
import cn.ssm_05.service.UserServiceImpl;

/**
 * 组件工厂 生产组件 创建对象
 * 
 * @author Administrator
 *
 */
public class MyBeanFactory {

	/**
	 * 根据name创建对象
	 * @param name对象名称
	 * @return
	 */
	public static Object getBean(String name) {
		if (name.equals("userDao")) {
			return new UserDaoImpl();
		} else if (name.equals("userService")) {
			return new UserServiceImpl();
		} else {
			return null;
		}
	}
}
